using Autofac;
using Autofac.Extensions.DependencyInjection;
using Simple.Web.Common;
using Simple.Web.Core;
using System.Collections.Generic;

namespace simple.web.core
{
	/// <summary>
	/// 
	/// </summary>
	public class Program
	{
		/// <summary>
		/// 
		/// </summary>
		/// <param name="args"></param>
		public static void Main(string[] args)
		{
			DateTime time = DateTime.Now;

            Console.WriteLine(time.ToString("yyyy-MM-dd"));

            var builder = WebApplication.CreateBuilder(args);


		
			Startup startup = new Startup(builder.Configuration);


			App.Configuration = builder.Configuration;


			startup.ConfigureServices(builder.Services);

			builder.Host.ConfigureContainer<ContainerBuilder>((builder) =>
			{
				startup.ConfigureContainer(builder);
			});

			builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());

			var app = builder.Build();


			// Configure the HTTP request pipeline.


			startup.Configure(app,app.Environment);
			app.Run();
		}
	}
}